/*年轻人，只管向前看，不要管自暴自弃者的话*/
package com.composetest.ui

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
import com.composetest.page.guide.navigation.guideScreen
import com.composetest.page.guide.navigation.navigationToGuide
import com.composetest.page.main.navigation.mainScreen
import com.composetest.page.main.navigation.navigationToMain
import com.composetest.page.product.detail.navigation.navigationToProductDetail
import com.composetest.page.product.detail.navigation.productDetailScreen
import com.composetest.page.splash.navigation.SPLASH_ROUTE
import com.composetest.page.splash.navigation.splashScreen

/**
 * create by itz on 2024/10/11 10:24
 * desc :
 **/

@Composable
fun MyApp(): Unit {
    val navController = rememberNavController()
    NavHost(navController = navController, startDestination = SPLASH_ROUTE) {
        splashScreen(
            toGuide = navController::navigationToGuide,
            toMain = navController::navigationToMain
        )

        guideScreen(toBack = navController::popBackStack)

        mainScreen(toProductDetail = navController::navigationToProductDetail)

        productDetailScreen(toBack = navController::popBackStack)
    }
}